#pragma once
#include "PDTExpBoolSing.h"
#include "PDTConst.h"

class PDTBoolConst :  public PDTExpBoolSing, public PDTConst, public TraverseIfc <PDTBoolConst, PDTNode> { 
    public: TRAVERSAL_IFC_IMPL(PDTBoolConst)
private:
	bool value;
public:
	PDTBoolConst(PDTCodeGraph & CG, bool value);
	bool getValue() {
        if (this == NULL) pdt_throw PDTNullValEx;
		return value;
	}
	NodeTypeEnum getType() {
		return PDTBoolConst_Em;
	}
	virtual bool isBoolConst() {
		return true;
	}
	virtual bool isBool() {
		return true;
	}
    virtual bool isEqual (const PDTConst & rhs) const {
        if (!rhs.getNode()->isBoolConst())
            return false;
        return value == rhs.getBoolean();
    }
    virtual bool getBoolean () const {
        return value;
    }
	virtual PDTNode* getNode() const {
		return (PDTNode*)this;
	}

	virtual bool eval(PDTCodeGraph &CG)
	{
		return true;
	}

	virtual PDTNode* clone(PDTCodeGraph &CG)
	{
		return this;
	}

	virtual stringstream & toString(stringstream & ss) const {
		ss << (value? "true" : "false") ;
		return ss;
	}
	virtual Z3_ast Z3NodeVisit (PDTZ3Visitor &ZV);
};

